#if !defined(_SVECTORTYPEDESCRIPTOR_H)
#define _SVECTORTYPEDESCRIPTOR_H

#include <boost/foreach.hpp>

#include "TypeDescriptor.h"
#include "Utility.h"

CREATE_ALIAS( SVectorTypeDescriptor );

/**
 * Class used to store a SVector type descriptor.
 */
class DECLARATION_DLL SVectorTypeDescriptor : public TypeDescriptor
{
	/** The type of vector elements */
	SType itemType;

	/** The type descriptor of vector elements (valid only if itemType is a complex type). */
	TypeDescriptorSp itemTypeDescriptor;

	/**
	 * SVectorTypeDescriptor constructor to create the type descriptor for a SVector of simple types
	 */
	SVectorTypeDescriptor(string pluginName, string name, string description, SType itemType) : TypeDescriptor(pluginName, name, description)
	{
		this->itemType = itemType;
	}

	/**
	 * SVectorTypeDescriptor constructor to create the type descriptor for a SVector of complex types
	 */
	SVectorTypeDescriptor(string pluginName, string name, string description, TypeDescriptorSp itemTypeDescriptor) : TypeDescriptor(pluginName, name, description)
	{
		this->itemType = itemTypeDescriptor->GetDescribedType();
		this->itemTypeDescriptor = itemTypeDescriptor;
	}

public:

	/**
	* Get the item type
	*/
	virtual SType GetItemType()
	{
		return itemType;
	}

	/**
	* Get the item type descriptor
	*/
	virtual TypeDescriptorSp GetItemTypeDescriptor()
	{
		return itemTypeDescriptor;
	}

	/**
	* Get the item type fully qualified name
	*/
	string GetFullyQualifiedItemTypeName();

	/**
 	 * Returns true if the type descriptor describe the specified type.
 	 */
	virtual bool Describe(SType type)
	{
		return type == STypeVector;
	}

	/**
	* Returns the type described from this type descriptor (STypeVector)
	*/
	virtual SType GetDescribedType()
	{
		return STypeVector;
	}

	/**
	 *   Factory method to create the type descriptor for a SVector of simple types
	 */
	static SVectorTypeDescriptorSp Create(string pluginName, string name, string description, SType itemType);

	/**
	 *   Factory method to create the type descriptor for a SVector of complex types
 	 */
	static SVectorTypeDescriptorSp Create(string pluginName, string name, string description, TypeDescriptorSp itemTypeDescriptor);
};

#endif  //_SVECTORTYPEDESCRIPTOR_H
